package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(50)"`
	Password string `gorm:"type:varchar(255)"`
}
type Article struct {
	gorm.Model
	Title           string `gorm:"type:varchar(50)"`
	Content         string `gorm:"type:varchar(255)"`
	Img             string `gorm:"type:varchar(255)"`
	CollectionCount int    `gorm:"type:int"`
}
type Collection struct {
	gorm.Model
	UserId    int     `gorm:"type:int"json:"user_id"`
	User      User    `gorm:"foreignKey:UserId"json:"user"`
	ArticleId int     `gorm:"type:int"json:"article_id"`
	Article   Article `gorm:"foreignKey:ArticleId"json:"article"`
}
